<?php 
	$x = 5;		//global scope

	function test(){
		// echo $x;	//local scope			
		// The script above will not produce any output because the echo statement refers to the local scope variable $x, which has not been assigned a value within this scope.

		global $x;
		echo $x, '<br>';

		// echo global $x;
		// Error, Have to declare before use the variable
	}

	test();
?>
<?php 
	$a = 3;
	$b = 10;

	function test1(){
		$GLOBALS['b'] += $GLOBALS['x'];
	}

	test1();
	echo $b;
?>